import 'package:flutter/material.dart';
import 'package:flutter_shopping/pages/home/home.dart';
import 'package:flutter_shopping/utils/colors.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({
    super.key,
  });

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      debugShowCheckedModeBanner: false,
      // 全局设置系统主题
      theme: ThemeData(
        useMaterial3: true,
        textTheme: Theme.of(context).textTheme.apply(bodyColor: kTextColor),
        colorScheme: ColorScheme.fromSeed(
          seedColor: Colors.white,
        ),
        appBarTheme: AppBarTheme.of(context).copyWith(
          backgroundColor: Colors.white,
          surfaceTintColor: Colors.white, // 必须设置，不然列表滚动后，导航栏会变成其他颜色
        ),
        bottomAppBarTheme: BottomAppBarTheme.of(context).copyWith(
          elevation: 0,
          color: Colors.white,
        ),
        scaffoldBackgroundColor: Colors.white,
      ),
      home: const HomePage(),
    );
  }
}
